from selenium import webdriver
import pytest
from po.Page.Page3 import Page3
from po.Page.Page2 import Page2
import json
@pytest.fixture
def driver():
    driver=webdriver.Firefox()
    driver.maximize_window()
    driver.implicitly_wait(3)
    yield driver
    driver.quit()
def send_json(file):
    with open(file,'r',encoding='utf-8') as f:
        data=json.load(f)
    return [(i['username'],i['pwd'])for i in data]
@pytest.mark.parametrize('username,pwd',send_json('hj.json'))
def test_126youxiang(driver,username,pwd):
    po=Page3(driver)
    po.test_login(username,pwd)
    po2 = Page2(driver)
    po2.test_126xiexin()
if __name__ == '__main__':
    pytest.main()